package com.sc.nft.feign;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.req.mallCart.*;
import com.sc.nft.sup.PageResult;
import com.sc.nft.sup.Result;
import com.sc.nft.vo.mallcart.MallCartListVO;
import com.sc.nft.vo.mallcart.MiniMallCartVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Author：LiGen
 * @Package：com.sc.nft.feign
 * @Project：sc_metago
 * @name：WxMallCartClient
 * @Date：2024/5/16 20:19
 * @Filename：WxMallCartClient
 */
@FeignClient(name = "meta-mall-mini-app", path = "/wxMiniMall/cart")
public interface WxMallCartClient {

    /**
     * 操作购物车
     *
     * @param req
     * @return
     */
    @PostMapping(value = "/edit", produces = MediaType.APPLICATION_JSON_VALUE)
    Result editCart(@RequestBody CartEditReq req);

    /**
     * 获取购物车数量
     *
     * @param req
     * @return
     */
    @PostMapping(value = "/num", produces = MediaType.APPLICATION_JSON_VALUE)
    Integer num(@RequestBody CartOneReq req);

    /**
     * 小程序购物车分页
     *
     * @param req
     * @return
     */
    @PostMapping(value = "/page", produces = MediaType.APPLICATION_JSON_VALUE)
    Page<MiniMallCartVO> page(@RequestBody MiniMallCartPageReq req);

    /**
     * 获取购物车
     *
     * @param req
     * @return
     */
    @PostMapping(value = "/list", produces = MediaType.APPLICATION_JSON_VALUE)
    Result<List<MallCartListVO>> cartList(@RequestBody CartListReq req);

    /**
     * 删除购物车
     *
     * @param req
     * @return
     */
    @PostMapping(value = "/delete", produces = MediaType.APPLICATION_JSON_VALUE)
    Result deleteCart(@RequestBody RemoveCartReq req);

    /**
     * 购物车结算
     *
     * @param req
     * @return
     */
    @PostMapping(value = "/settle", produces = MediaType.APPLICATION_JSON_VALUE)
    Result settleCart(@RequestBody CartSettleReqs req);
}
